;;;; board.lisp

(in-package #:gamao-impl)

(defclass board ()
  ((cube :accessor cube-value :initarg :cube)
   (cube-owner :accessor cube-owner :initform nil)
   (checkers :accessor checkers :initarg :checkers)
   (dice-rolling-p :accessor dice-rolling-p :initform nil)
   (cube-offered-p :accessor cube-offered-p :initform nil)
   (die1 :reader die1 :initform nil)
   (die2 :reader die2 :initform nil)
   (current-player :accessor current-player :initform nil)
   (game-result :accessor game-result :initform nil)
   (board-winner :accessor winner :initform nil)))

(defmethod set-dice ((board board) die1 die2)
  (setf (slot-value board 'die1) die1
        (slot-value board 'die2) die2))

(defmethod pick-up-dice :after ((board board) player)
  (commit-checker-position (checkers board)))
